package com.hayrullah.cinema.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "Saloon_Table")
public class Saloon extends AbstractEntity {

	private static final long serialVersionUID = 1L;

	private String saloon_name;
	private Integer seat_count;
	@ManyToMany(mappedBy ="saloon")
	private Set<Movie> movies;
	@ManyToMany(mappedBy="saloons")
	private Set<Seats> seats;
	

	public Saloon() {
		this.movies = new HashSet<Movie>();
		this.seats = new HashSet<Seats>();

	}

	@Override
	public long getid() {
		return super.getid();
	}

	@Column(name = "Saloon_name", nullable = false, length = 10)
	public String getSaloon_name() {
		return saloon_name;
	}

	public void setSaloon_name(String saloon_name) {
		this.saloon_name = saloon_name;
	}

	@Column(name = "Seat_Count", nullable = false)
	public Integer getSeat_count() {
		return seat_count;
	}

	public void setSeat_count(Integer seat_count) {
		this.seat_count = seat_count;
	}
	public Set<Movie> getMovies() {
		return movies;
	}

	public void setMovies(Set<Movie> movies) {
		this.movies = movies;
	}

	@OneToMany(mappedBy = "Saloons", fetch = FetchType.EAGER)
	public Set<Seats> getSeats() {
		return seats;
	}

	public void setSeats(Set<Seats> seats) {
		this.seats = seats;
	}

}
